with Ada.Text_IO;
With Ada.Strings.Unbounded;
use Ada.Strings.Unbounded;
with TASO;

procedure Main is
   package TASNATURAL is new TASO(OBJET => NATURAL,"<=" => "<=");
   package TASSTRING is new TASO(objet => Ada.Strings.Unbounded.Unbounded_String, "<=" => "<=");
   type Choix is (Creer, Mettre, Retirer, Ieme, Dans, Taille);
   use TASSTRING;
   TT : TASSTRING.tas;
   C : Choix;
begin

   loop
   Ada.Text_IO.Put_Line("Bienvenue, que voulez vous faire ((Creer, Mettre (OBJET), Retirer(OBJET), Ieme(INT), Dans(OBJET), Taille)");
   C := Choix'Value(Ada.Text_IO.Get_Line);

   Case C is
      When Creer =>  TT := Creer;
      When Mettre => TT := Mettre(TT,Ada.Strings.Unbounded.To_Unbounded_String(Ada.Text_IO.Get_Line));
      When Retirer => TT := Retirer(TT,Ada.Strings.Unbounded.To_Unbounded_String(Ada.Text_IO.Get_Line));
      When Ieme => Ada.Text_IO.Put_Line(Ada.Strings.Unbounded.To_String(Ieme(TT,Integer'Value(Ada.Text_IO.Get_Line))));
      When Dans => Ada.Text_IO.Put_Line(Boolean'Image(Dans(TT,Ada.Strings.Unbounded.To_Unbounded_String(Ada.Text_IO.Get_Line))));
      When Taille => Ada.Text_IO.Put_Line(Integer'Image(Taille(TT)));

      End Case;

     end loop;
end Main;
